Patterns were learned on the 6mo MENs and the gut cell atlas was projected into them. Now look at the subset of non-fetal healthy samples and visualize the pattern usages

library(monocle3)
library(dplyr)
library(here)

source(here("scripts/accessory_functions/monocle_mods.R"))
source(here("scripts/accessory_functions/pattern_plotting.R"))
obj_fn <- "/data/users/jared/atlas_processing/gut_cell_atlas/data/mesenchymal_gut_nonfetal_healthy.Rds"

cds <- readRDS(obj_fn)

Pattern definitions in 6month LMMP

knitr::include_graphics(here("plots/NMF/lmmp/old_pattern_run/50dims/LMMP_pattern_feature_correlation.pdf"))
cell_wt <- data.table::fread(here("teichman_gut_atlas/data/gut_atlas_in_6mo_LMMP_old_patterns.csv"), data.table = F)
colnames(cell_wt)[1] <- "cell_index"

all(colnames(cds) %in% rownames(cell_wt))
[1] FALSE

From previously generated pattern projections, load in values and merge with existing pData

pData(cds) <- pData(cds) %>%
  as.data.frame() %>%
  tibble::rownames_to_column(var = "cell_index") %>%
  left_join(., cell_wt, by = "cell_index") %>%
  tibble::column_to_rownames(var = "cell_index") %>%
  DataFrame
plot_cells_mod(cds, color_cells_by = "Age") + facet_wrap(~ Age)
No trajectory to plot. Has learn_graph() been called yet?
Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

Warning: ggrepel: 8 unlabeled data points (too many overlaps). Consider
increasing max.overlaps

plot_cells_mod(cds, color_cells_by = "Integrated_05", label_cell_groups = F) +
  theme(legend.position = "none") +
  facet_wrap(~ Integrated_05)
No trajectory to plot. Has learn_graph() been called yet?

npatt <- 50
lapply(1:npatt, plotCellPatterns, cds, do.clip = c(0.01,0.99))
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
No trajectory to plot. Has learn_graph() been called yet?
Cells aren't colored in a way that allows them to be grouped.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
[[1]]


[[2]]


[[3]]


[[4]]


[[5]]


[[6]]


[[7]]


[[8]]


[[9]]


[[10]]


[[11]]


[[12]]


[[13]]


[[14]]


[[15]]


[[16]]


[[17]]


[[18]]


[[19]]


[[20]]


[[21]]


[[22]]


[[23]]


[[24]]


[[25]]


[[26]]


[[27]]


[[28]]


[[29]]


[[30]]


[[31]]


[[32]]


[[33]]


[[34]]


[[35]]


[[36]]


[[37]]


[[38]]


[[39]]


[[40]]


[[41]]


[[42]]


[[43]]


[[44]]


[[45]]


[[46]]


[[47]]


[[48]]


[[49]]


[[50]]

LS0tCnRpdGxlOiAiUiBOb3RlYm9vayIKb3V0cHV0OiBodG1sX25vdGVib29rCi0tLQoKUGF0dGVybnMgd2VyZSBsZWFybmVkIG9uIHRoZSA2bW8gTUVOcyBhbmQgdGhlIGd1dCBjZWxsIGF0bGFzIHdhcyBwcm9qZWN0ZWQgaW50byB0aGVtLiBOb3cgbG9vayBhdCB0aGUgc3Vic2V0IG9mIG5vbi1mZXRhbCBoZWFsdGh5IHNhbXBsZXMgYW5kIHZpc3VhbGl6ZSB0aGUgcGF0dGVybiB1c2FnZXMKCmBgYHtyLCBtZXNzYWdlID0gRkFMU0UsIHJlc3VsdHMgPSAnaGlkZSd9CmxpYnJhcnkobW9ub2NsZTMpCmxpYnJhcnkoZHBseXIpCmxpYnJhcnkoaGVyZSkKCnNvdXJjZShoZXJlKCJzY3JpcHRzL2FjY2Vzc29yeV9mdW5jdGlvbnMvbW9ub2NsZV9tb2RzLlIiKSkKc291cmNlKGhlcmUoInNjcmlwdHMvYWNjZXNzb3J5X2Z1bmN0aW9ucy9wYXR0ZXJuX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